import options from './bar'
import * as echarts from 'echarts'
// const { echarts } = window

export default (element, data) => {
  const old = echarts.getInstanceByDom(element)
  if (old) old.dispose()
  const chart = echarts.init(element, 'theme')
  if(data) {

  }
  chart.setOption(options)
  return chart
}
